//=============================================================================
//
//   Copyright (C) 2020 All rights reserved.
//
//   Filename:		displace.rs
//
//   Author: Wang Zhecheng - wangzhecheng@yeah.net
//
//   Date: 2020-10-28 07:08
//
//   Last Editors: Wang Zhecheng - wangzhecheng@yeah.net
//
//   Last modified:	2020-10-29 23:41
//
//   Description:
//
//=============================================================================
use crate::component::{dof::Dof, node::Node};
use crate::dimension::{DimType, HasDimension};
use crate::method::unknowns::UnknownType;
use nalgebra::dimension::Dim;
use std::marker::PhantomData;

#[derive(Debug)]
pub struct DisplaceUnknwon<DT: DimType> {
    _marker: PhantomData<DT>,
}

impl<DT: DimType> UnknownType<DT> for DisplaceUnknwon<DT> {
    fn set_nodal_dofs(&self, node: &mut Node<DT>) {
        let dim = node.get_dim();
        for i in 0..dim {
            node.append_dof("x".to_string() + i.to_string().as_str(), Dof::default());
        }
    }
}
default_dt_marker!(DisplaceUnknwon<DT: DimType>);
